# str()
name = '张三'
age = 23
print('我叫'+name+'，今年'+str(age)+'岁')     # '+   +' 类型连接符，可以将相同类型的数据进行拼接

a = 123
b = 198.8
c = True
print('------str()将其他数据类型转成str类型-------')
print(a,type(a))
print(b,type(b))
print(c,type(c))
print(type(str(a)))
print(type(str(b)))
print(type(str(c)))

# int()
print('------int()将其他数据类型转成int类型-------')
m1 = 123
m2 = 120.7
s1 = '1234'
s2 = '1222.4'
s3 = 'huawei'
b1 = False

print(m2,int(m2),type(int(m2)))
print(s1,int(s1),type(int(s1)))
# print(s2,int(s2),type(int(s2)))  # 无法正常运行
# print(s3,int(s3),type(int(s3)))  #  报错
print(b1,int(b1),type(int(b1)))

# float()
print('------float()将其他数据类型转成float类型-------')
x1 = 123
x2 = '123'
x3 = '12222.45565'
y1 = 'hello'
t1 = True

print(x1,float(x1),type(float(x1)))
print(x2,float(x2),type(float(x2)))
print(x3,float(x3),type(float(x3)))
# print(y1,float(y1),type(float(y1)))
print(t1,float(t1),type(float(t1)))

